docs: make version selector keyboard accessible - #2726
Open
kfenner wants to merge 1 commit into
Open
Conversation
Replace the click-only override with a WAI-ARIA disclosure navigation pattern so the docs version switcher is operable by mouse and keyboard. The previous hover disable also removed Material's :focus-within open path, so Tab never reached the list. The button now uses aria-expanded and aria-controls, the list is hidden until open, and Tab, arrows, Home/End, and Escape move through the real version links. Position the dropdown below the toggle so a second click closes it instead of activating a version, and lift the panel from the header.
Member
Author
|
@chintankavathia @dr-itz Could somebody merge me this? It's bugging me and I want to see if this might fix the current behavior. When the behavior is good, we can backport to v49, v48. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #2723. The click-only version selector could not be opened or operated with the keyboard because the hover override also disabled Material's
:focus-withinpath.This implements a WAI-ARIA disclosure navigation pattern (same class of control as MDN / many docs version switchers):
aria-expanded/aria-controls(noaria-haspopup)ul,hiddenwhen closed,aria-current="page"on the current versionTested by injecting the new CSS/JS into https://element.siemens.io/development/ (click, click-again, hover, Tab, arrows, Escape, ARIA, light/dark).
Backports to v49 and v48 are intentionally not included yet.
Testing
Documentation.
Examples.
Dashboards Demo.
Playwright report.
Coverage Reports: